/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ro.futurefeed.view;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import ro.futurefeed.model.User;

/**
 *
 * @author Georgian
 */
@Component("userViewData")
@Scope("view")
public class UserViewData implements Serializable{
        
    private String accessToken;
    private User user;
    private List<FeedView> feeds = new ArrayList<FeedView>();
    private FeedView feed = new FeedView();

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }
    
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<FeedView> getFeeds() {
        return feeds;
    }

    public void setFeeds(List<FeedView> feeds) {
        this.feeds = feeds;
    }

    public FeedView getFeed() {
        return feed;
    }

    public void setFeed(FeedView feed) {
        try {
            this.feed = feed.clone();
        } catch (CloneNotSupportedException ex) {
            Logger.getLogger(UserViewData.class.getName()).log(Level.SEVERE, "Error cloning FeedView", ex);
        }
    }
}
